<extend name='Public/demo' />
<block name='search'>
<li>
	<form action="{:U('index')}" method="get">
		<input style="font-size:12px;" type="text" class="form-control search" placeholder="用户名" name="search_username" id="search_username">
	</form>
</li>
</block>

<block name='contents'>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<header class="panel-heading">用户列表</header>
				<table class="table table-striped table-advance table-hover">
					<thead>
						<tr>
							<th> <i class="icon-location-arrow"></i>
								ID
							</th>
							<th> <i class="icon-bullhorn"></i>
								用户名
							</th>
							<th class="hidden-phone">
								<i class="icon-question-sign"></i>
								上次登录时间
							</th>
							<th>
								<i class="icon-bookmark"></i>
								等级
							</th>
							<th>
								<i class=" icon-edit"></i>
								状态
							</th>
							<th>
								<i class="icon-upload-alt"></i>
								是否在线
							</th>
							<th>
								<i class=" icon-wrench"></i>
								操作
							</th>
						</tr>
					</thead>
					<tbody>
						<foreach name="res" item="vo" >
							<tr>
								<td>{$vo.user_id}</td>
								<td>{$vo.username}</td>
								<td class="hidden-phone">{$vo.lasttime|date="Y-m-d h:i:s",###}</td>
								<td>111</td>
								<td>
									<span class="label label-info label-mini">
										<if condition="$vo['lock'] lt 50">
											活跃
											<else />
											封号
										</if>
									</span>
								</td>
								<td>
									<span class="label label-success label-mini">{$vo['online']==1?'在线':'离线'}</span>
								</td>
								<td>
									<button class="btn btn-success btn-xs user_detail"  type="button"  data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">
										<i class="icon-ok"></i>
									</button>
									<a class="btn btn-primary btn-xs" href="{:U('edit', array('id'=>
										$vo['user_id']))}">
										<i class="icon-pencil"></i>
									</a>
									<button class="btn btn-danger btn-xs user_del">
										<i class="icon-trash "></i>
									</button>
								</td>
							</tr>
						</foreach>

					</tbody>
				</table>
			</section>
		</div>
	</div>

	<div class="row" style="margin-top:-10px">
		<div class="col-sm-4 col-sm-offset-4">
			<div class="dataTables_info" id="dataTables-example_info" role="status" aria-live="polite">共{$allpage}页,当前第{$p}页,本页显示{$rows}条记录,共{$total}条记录</div>
		</div>
		<style type="text/css">
					  #pages a,#pages span{ background-color: #fff;
							  border: 1px solid #ddd;
							  color: #337ab7;
							  float: left;
							  line-height: 1.42857;
							  margin-left: -1px;
							  padding: 6px 12px;
							  position: relative;
							  text-decoration: none;}
					  #pages span {
							background-color: #337ab7;
							border-color: #337ab7;
							color: #fff;
							cursor: default;
							z-index: 2;
							}
				  </style>

		<div class="col-sm-4" >
			<div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
				<div id="pages">{$pages}</div>
			</div>
		</div>
	</div>

	<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" style="width:100%">
		<div class="modal-dialog" role="document">
			<div class="modal-content" style="width:500px"></div>
		</div>
	</div>

	<script>
			// 定义删除发送ajax的url提交页面的地址, 在index.js中可以使用
			  var del_url = '{:U('delete')}';
			  var detail_url = '{:U('detail')}';

			</script>
	<script src="__PUBLIC__/Admin/User/index.js"></script>
	<style>
			  .newinsert li{
					height:30px;
			  }
			</style>

</block>